/* GUI CONVERTED from rcrbmt.p (converter v1.76) Fri May  3 13:21:27 2002 */
/* rcrbmt.p - Release Management Customer Schedules - Retrobill Maint         */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.8.1.6 $                                                       */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 7.3      LAST MODIFIED: 10/12/92           BY: WUG *G462*        */
/* REVISION: 7.4      LAST MODIFIED: 09/13/93           BY: WUG *H109*        */
/* Oracle changes (share-locks)    09/12/94             BY: rwl *GM44*        */
/* REVISION: 7.5      LAST MODIFIED: 12/18/94           BY: mwd *J034*        */
/* REVISION: 7.4      LAST MODIFIED: 03/22/95           BY: aed *G0J0*        */
/* REVISION: 7.5      LAST MODIFIED: 10/25/95           BY: dpm *J044*        */
/* REVISION: 8.6      LAST MODIFIED: 12/30/96   BY: *K03W* Vinay Nayak-Sujir  */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 07/19/00   BY: *N0GF* Mudit Mehta        */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown         */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.8.1.4    BY: Jean Miller          DATE: 03/22/01 ECO: *P008*   */
/* Revision: 1.8.1.5    BY: Hareesh V.           DATE: 09/12/01 ECO: *M1KT*   */
/* $Revision: 1.8.1.6 $   BY: Katie Hilbert        DATE: 04/15/02 ECO: *P03J*   */

/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/
/* RETROBILL MASTER MAINT */

{mfdtitle.i "2+ "}

define new shared variable cmtindx like cmt_indx.
define variable global_order     as character.
define variable global_line      as integer.
define variable cmmts            like soc_hcmmts label "Comments" no-undo.
define variable del-yn           like mfc_logical no-undo.
define variable rbm_memo         like mfc_logical label "Memo Per Item" no-undo.
define variable rbd_eff_from     as date label "From Ship Date" no-undo.
define variable rbd_eff_to       as date label "To Ship Date" no-undo.
define variable rbd_price_change like mfc_logical label "Price/Change"
                                 format "Price/Change" no-undo.
define variable rbd_amt          as decimal label "Amount"
                                 format "->>>,>>>,>>9.99<<<" no-undo.
define variable rbd_memo_invoice as character label "Memo Invoice" no-undo.
define variable so_db            as character no-undo.
define variable begstr           as character no-undo.
define variable fldnbr           as integer no-undo.
define variable impexp           like mfc_logical no-undo.

{rcordfrm.i}

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
rbm_cust     colon 30
   ad_name      no-label
   rbm_auth     colon 30 label "Amendment Number"
   skip(1)
   rbm_eff      colon 30 label "As-of Date"
   rbm_rsn      colon 30
   rbm_memo     colon 30
   cmmts        colon 30
 SKIP(.4)  /*GUI*/
with frame a1 side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a1-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a1 = F-a1-title.
 RECT-FRAME-LABEL:HIDDEN in frame a1 = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a1 =
  FRAME a1:HEIGHT-PIXELS - RECT-FRAME:Y in frame a1 - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a1 = FRAME a1:WIDTH-CHARS - .5.  /*GUI*/


/* SET EXTERNAL LABELS */
setFrameLabels(frame a1:handle).


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
{rcordfma.i}
   rbd_eff_from         colon 30
   rbd_price_change     colon 60
   rbd_eff_to           colon 30
   rbd_amt              colon 60
   rbd_memo_invoice     colon 30
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

mainloop:
repeat:
/*GUI*/ if global-beam-me-up then undo, leave.

   do on error undo, retry with frame a1:
/*GUI*/ if global-beam-me-up then undo, leave.

      prompt-for
         rbm_cust
         rbm_auth
      editing:

         global_addr = input rbm_cust.

         if frame-field = "rbm_cust" then do:
            {mfnp05.i rbm_mstr rbm_cust yes rbm_cust "input rbm_cust"}
         end.
         else
            if frame-field = "rbm_auth" then do:
            {mfnp05.i rbm_mstr rbm_cust
               "rbm_cust = input rbm_cust"
               rbm_auth "input rbm_auth"}
         end.
         else do:
            status input.
            readkey.
            apply lastkey.
         end.

         if recno <> ? then do:
            find ad_mstr where ad_addr = rbm_cust no-lock.
            display
               rbm_cust
               ad_name
               rbm_auth
               rbm_eff
               rbm_rsn
               (rbm_cmtindx > 0 ) @ cmmts.
         end.
      end. /* PROMPT-FOR...EDITING */

      if input rbm_auth = "" then do:
         /* Blank not allowed */
         {pxmsg.i &MSGNUM=40 &ERRORLEVEL=3}
         next-prompt rbm_auth.
         undo, retry.
      end.

      find cm_mstr where cm_addr = input rbm_cust no-lock no-error.
      if not available cm_mstr then do:
         /* Invalid Customer */
         {pxmsg.i &MSGNUM=8111 &ERRORLEVEL=3}
         undo, retry.
      end.

      find ad_mstr where ad_addr = cm_addr no-lock.

      display ad_name.

      find rbm_mstr using rbm_cust and rbm_auth
      exclusive-lock no-error.

      if not available rbm_mstr then do:
         /* Adding new Record */
         {pxmsg.i &MSGNUM=1 &ERRORLEVEL=1}

         create rbm_mstr.
         assign
            rbm_cust
            rbm_auth.
      end.

      if substring(rbm_status,1,1) = "i" then do:
         /* Retrobill Memo has already been created */
         {pxmsg.i &MSGNUM=8127 &ERRORLEVEL=2}
      end.
      assign
         cmmts = (rbm_cmtindx > 0)
         begstr = string(rbm_cust,"x(8)") + string(rbm_auth,"x(16)")
         ststatus = stline[2].
      status input ststatus.

      do on error undo, retry:
/*GUI*/ if global-beam-me-up then undo, leave.


         rbm_memo = substring(rbm_ar_nbr,1,1) = "y".

         update
            rbm_eff
            rbm_rsn
            rbm_memo
            cmmts
         go-on(F5 CTRL-D).

         if lastkey = keycode("F5") or
            lastkey = keycode("CTRL-D")
         then do:

            del-yn = yes.
            {pxmsg.i &MSGNUM=11 &ERRORLEVEL=1 &CONFIRM=del-yn}
            if del-yn = no then undo, retry.

            for each cmt_det where cmt_indx = rbm_cmtindx
            exclusive-lock:
               delete cmt_det.
            end.

            for each qad_wkfl
               where qad_key1 = "rbd_det"
                 and qad_key2 begins begstr
            exclusive-lock:
               delete qad_wkfl.
            end.

            delete rbm_mstr.
            clear frame a1.
/*GUI*/ RECT-FRAME-LABEL:SCREEN-VALUE in frame a1 = F-a1-title.
            hide frame a no-pause.
            next mainloop.

         end. /* IF F5 OR CTRL-D DELETE */

         if rbm_eff = ? then do:
            /* Effective Date Required */
            {pxmsg.i &MSGNUM=8112 &ERRORLEVEL=3}
            next-prompt rbm_eff.
            undo, retry.
         end.

         rbm_ar_nbr = substring(string(rbm_memo),1,1).

      end.
/*GUI*/ if global-beam-me-up then undo, leave.
 /* DO ON ERROR... */

      if cmmts then do:
         assign
            global_ref = getTermLabel("RETRO",20)
            cmtindx = rbm_cmtindx.
         {gprun.i ""gpcmmt01.p"" "(input ""rbm_mstr"")"}
/*GUI*/ if global-beam-me-up then undo, leave.

         rbm_cmtindx = cmtindx.
         view frame a1.
      end.

   end.
/*GUI*/ if global-beam-me-up then undo, leave.
 /* DO ON ERROR...FRAME A1 */

   fldnbr = 1.
   clear frame a.
/*GUI*/ RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.

   run rb_dtl.

end.
/*GUI*/ if global-beam-me-up then undo, leave.
 /* mainloop */

PROCEDURE rb_dtl:
/*--------------------------------------------------------------------
  Purpose:
  Parameters:
  Notes:
----------------------------------------------------------------------*/

   do with frame a1:
      find rbm_mstr using rbm_cust and rbm_auth exclusive-lock.
   end.

   detailloop:
   repeat with frame a:
/*GUI*/ if global-beam-me-up then undo, leave.


      if fldnbr = 1 then next-prompt scx_shipfrom.
      else
      if fldnbr = 2 then next-prompt scx_shipto.
      else
      if fldnbr = 3 then next-prompt scx_part.
      else
      if fldnbr = 4 then next-prompt scx_po.
      else
      if fldnbr = 5 then next-prompt scx_custref.
      else
      if fldnbr = 6 then next-prompt scx_modelyr.
      else
      if fldnbr = 7 then next-prompt scx_order.
      else
      if fldnbr = 8 then next-prompt scx_line.

      prompt-for
         scx_shipfrom
         scx_shipto
         scx_part
         scx_po
         scx_custref
         scx_modelyr
         scx_order
         scx_line
      editing:

         assign
            global_order = input frame a scx_order
            global_line = input frame a scx_line.

         if frame-field = "scx_shipfrom" then do:
            {mfnp05.i qad_wkfl qad_index1
               "qad_key1 = ""rbd_det"" and qad_key2 begins begstr"
               qad_key2
               "begstr + input frame a scx_shipfrom"}
            fldnbr = 1.
         end.
         else if frame-field = "scx_shipto" then do:
            {mfnp05.i qad_wkfl qad_index1
               "qad_key1 = ""rbd_det""
                 and qad_key2 begins begstr
                 + string(input frame a scx_shipfrom,""x(8)"")"
               qad_key2
               "begstr + string(input frame a scx_shipfrom,""x(8)"")
               + input frame a scx_shipto"}

            fldnbr = 2.
         end.
         else if frame-field = "scx_part" then do:
            {mfnp05.i qad_wkfl qad_index1
               "qad_key1 = ""rbd_det""
                  and qad_key2 begins begstr
                  + string(input frame a scx_shipfrom,""x(8)"")
                  + string(input frame a scx_shipto,""x(8)"")"
               qad_key2
               "begstr + string(input frame a scx_shipfrom,""x(8)"")
               + string(input frame a scx_shipto,""x(8)"")
               + input frame a scx_part"}

            fldnbr = 3.
         end.
         else if frame-field = "scx_po" then do:
            {mfnp05.i
               qad_wkfl qad_index1
               "qad_key1 = ""rbd_det""
                  and qad_key2 begins begstr
                  + string(input frame a scx_shipfrom,""x(8)"")
                  + string(input frame a scx_shipto,""x(8)"")
                  + string(input frame a scx_part,""x(18)"")"
               qad_key2
               "begstr + string(input frame a scx_shipfrom,""x(8)"")
               + string(input frame a scx_shipto,""x(8)"")
               + string(input frame a scx_part,""x(18)"")
               + input frame a scx_po"}

            fldnbr = 4.
         end.
         else if frame-field = "scx_custref" then do:
            {mfnp05.i
                  qad_wkfl
                  qad_index1
                  "qad_key1 = ""rbd_det""
                  and qad_key2 begins begstr
                  + string(input frame a scx_shipfrom,""x(8)"")
                  + string(input frame a scx_shipto,""x(8)"")
                  + string(input frame a scx_part,""x(18)"")
                  + string(input frame a scx_po,""x(22)"")"
                  qad_key2
                  "begstr + string(input frame a scx_shipfrom,""x(8)"")
                          + string(input frame a scx_shipto,""x(8)"")
                          + string(input frame a scx_part,""x(18)"")
                          + string(input frame a scx_po,""x(22)"")
                          + input frame a scx_custref"}

            fldnbr = 5.
         end.
         else if frame-field = "scx_modelyr" then do:
            {mfnp05.i
                qad_wkfl
                qad_index1
                "qad_key1 = ""rbd_det""
                and qad_key2 begins begstr
                + string(input frame a scx_shipfrom,""x(8)"")
                + string(input frame a scx_shipto,""x(8)"")
                + string(input frame a scx_part,""x(18)"")
                + string(input frame a scx_po,""x(22)"")
                + string(input frame a scx_custref,""x(30)"")"
                qad_key2
                "begstr + string(input frame a scx_shipfrom,""x(8)"")
                        + string(input frame a scx_shipto,""x(8)"")
                        + string(input frame a scx_part,""x(18)"")
                        + string(input frame a scx_po,""x(22)"")
                        + string(input frame a scx_custref,""x(30)"")
                        + input frame a scx_modelyr"}

            fldnbr = 6.
         end.
         else if frame-field = "scx_order" then do:
            {mfnp05.i qad_wkfl qad_index3
               "qad_key5 = ""rbd_det""
                 and qad_key6 begins begstr"
               qad_key6
               "begstr + input frame a scx_order"}

            fldnbr = 7.
         end.
         else if frame-field = "scx_line" then do:
            {mfnp05.i qad_wkfl qad_index3
               "qad_key5 = ""rbd_det""
                and qad_key6 begins begstr
                + string(input frame a scx_order,""x(8)"") "
               qad_key6
               "begstr + string(input frame a scx_order,""x(8)"")
               + string(integer(input frame a scx_line),""99999"")"}

            fldnbr = 8.
         end.
         else do:
            status input.
            readkey.
            apply lastkey.
            fldnbr = 0.
         end.

         if fldnbr > 0 and recno <> ? then do:

            find ad_mstr where ad_addr = qad_charfld[2] no-lock.
            find pt_mstr where pt_part = qad_charfld[3] no-lock.

            find sod_det
            where sod_nbr = qad_charfld[5]
              and sod_line = integer(qad_charfld[6]) no-lock.

            display
               qad_charfld[1] @ scx_shipfrom
               qad_charfld[2] @ scx_shipto
               ad_name
               qad_charfld[3] @ scx_part
               pt_um
               sod_custpart
               sod_custref    @ scx_custref
               sod_modelyr    @ scx_modelyr
               qad_charfld[4] @ scx_po
               qad_charfld[5] @ scx_order
               integer(qad_charfld[6]) @ scx_line.

            assign
               rbd_eff_from = qad_datefld[1]
               rbd_eff_to   = qad_datefld[2]
               rbd_price_change = qad_charfld[9] = "y"
               rbd_amt = qad_decfld[1]
               rbd_memo_invoice = qad_charfld[10].

            display
               rbd_eff_from
               rbd_eff_to
               rbd_memo_invoice
               rbd_price_change
               rbd_amt.

         end. /* IF FLDNBR...RECNO <> "?" */

     end. /* PROMPT-FOR...EDITING */

      if fldnbr <= 6 then
         find scx_ref where
              scx_type = 1
          and scx_shipfrom = input frame a scx_shipfrom
          and scx_shipto   = input frame a scx_shipto
          and scx_part     = input frame a scx_part
          and scx_po       = input frame a scx_po
          and scx_custref = input frame a scx_custref
          and scx_modelyr = input frame a scx_modelyr
         no-lock no-error.

      else
         find scx_ref where
              scx_type = 1
          and scx_order = input frame a scx_order
          and scx_line  = input frame a scx_line
         no-lock no-error.

      if not available scx_ref then do:
         /* SCHED ORDER DETAIL DOES NOT EXIST */
         {pxmsg.i &MSGNUM=8104 &ERRORLEVEL=3}
         undo, retry.
      end.

      find si_mstr where si_site = scx_shipfrom no-lock.
      find ad_mstr where ad_addr = scx_shipto no-lock.
      find pt_mstr where pt_part = scx_part no-lock.
      find sod_det where sod_nbr = scx_order
                     and sod_line = scx_line no-lock.
      find so_mstr where so_nbr = sod_nbr no-lock.

      if ad_addr <> rbm_cust and ad_ref <> rbm_cust then do:
         /* Ship-To is not for this customer */
         {pxmsg.i &MSGNUM=606 &ERRORLEVEL=3}
         undo, retry.
      end.

      global_addr = so_cust.

      if not sod_sched then do:
         /* Line item is not scheduled */
         {pxmsg.i &MSGNUM=6004 &ERRORLEVEL=3}
         undo, retry.
      end.

      /*MUST BE IN SAME DATABASE AS ORDER CREATED IN*/
      so_db = trim(substring(so_conrep,15,20)).
      if so_db <> global_db then do:
         /* You must be in database */
         {pxmsg.i &MSGNUM=8148 &ERRORLEVEL=3 &MSGARG1=so_db}
        undo, retry.
      end.

      if sod_start_eff[1] > today or sod_end_eff[1] < today then do:
         /* Scheduled order is no longer effective */
         {pxmsg.i &MSGNUM=8105 &ERRORLEVEL=2}
      end.

      if sod_cum_qty[1] >= sod_cum_qty[3]
         and sod_cum_qty[3] > 0
      then do:
         /* Cum shipped qty >= Max order qty for order selected */
         {pxmsg.i &MSGNUM=8220 &ERRORLEVEL=2}
      end.

      display
         scx_shipfrom
         scx_shipto
         ad_name
         scx_part
         pt_um
         sod_custpart
         scx_po
         scx_custref
         scx_modelyr
         scx_order
         scx_line.

      find si_mstr where si_site = scx_shipfrom no-lock no-error.
      if not available si_mstr then do:
         /* Site does not exist */
         {pxmsg.i &MSGNUM=708 &ERRORLEVEL=3}
         fldnbr = 1.
         undo detailloop, retry.
      end.

      else do:
         {gprun.i ""gpsiver.p""
            "(input si_site, input recid(si_mstr), output return_int)"}
/*GUI*/ if global-beam-me-up then undo, leave.

         if return_int = 0 then do:
            /* User does not have access to site */
            {pxmsg.i &MSGNUM=2710 &ERRORLEVEL=3 &MSGARG1=si_site}
            fldnbr = 1.
            undo detailloop, retry.
         end.
      end.
      assign
         global_order = sod_nbr
         global_line = sod_line.

      find qad_wkfl where
           qad_key1 = "rbd_det"
       and qad_key2 = begstr + string(scx_shipfrom,"x(8)")
                             + string(scx_shipto,"x(8)")
                             + string(scx_part,"x(18)")
                             + string(scx_po,"x(22)")
                             + string(scx_custref,"x(30)")
                             + string(scx_modelyr,"x(4)")
      exclusive-lock no-error.

      if not available qad_wkfl then do:
         /* Adding new Record */
         {pxmsg.i &MSGNUM=1 &ERRORLEVEL=1}
         create qad_wkfl.
         assign
            qad_key1 = "rbd_det"
            qad_key2 = begstr + string(scx_shipfrom,"x(8)")
                              + string(scx_shipto,"x(8)")
                              + string(scx_part,"x(18)")
                              + string(scx_po,"x(22)")
                              + string(scx_custref,"x(30)")
                              + string(scx_modelyr,"x(4)")
            qad_key3 = "rbd_det"
            qad_key4 = string(scx_order,"x(8)")
                     + string(integer(scx_line),"99999")
            qad_key5 = "rbd_det"
            qad_key6 = begstr + string(scx_order,"x(8)")
                              + string(integer(scx_line),"99999")
            qad_charfld[1] = scx_shipfrom
            qad_charfld[2] = scx_shipto
            qad_charfld[3] = scx_part
            qad_charfld[4] = scx_po
            qad_charfld[5] = scx_order
            qad_charfld[6] = string(scx_line)
            qad_charfld[7] = rbm_cust
            qad_charfld[8] = rbm_auth
            qad_charfld[9] = "y".
      end.

      assign
         rbd_eff_from = qad_datefld[1]
         rbd_eff_to   = qad_datefld[2]
         rbd_price_change = qad_charfld[9] = "y"
         rbd_amt = qad_decfld[1]
         rbd_memo_invoice = qad_charfld[10].

      ststatus = stline[2].
      status input ststatus.

      do on error undo, retry:
/*GUI*/ if global-beam-me-up then undo, leave.

         update
            rbd_eff_from
            rbd_eff_to
            rbd_memo_invoice
            rbd_price_change
            rbd_amt
         go-on(F5 CTRL-D).

         if lastkey = keycode("F5") or
            lastkey = keycode("CTRL-D")
         then do:
            del-yn = yes.
            {pxmsg.i &MSGNUM=11 &ERRORLEVEL=1 &CONFIRM=del-yn}
            if del-yn = no then undo, retry.
            delete qad_wkfl.
            clear frame a.
/*GUI*/ RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
            next detailloop.
         end.

         if rbd_eff_from = ? then do:
            /* Invalid Date */
            {pxmsg.i &MSGNUM=27 &ERRORLEVEL=3}
            next-prompt rbd_eff_from.
            undo, retry.
         end.

         if rbd_eff_to = ? then do:
            /* Invalid Date */
            {pxmsg.i &MSGNUM=27 &ERRORLEVEL=3}
            next-prompt rbd_eff_to.
            undo, retry.
         end.

         if rbd_eff_to < rbd_eff_from then do:
            /* End date cannot be before start date */
            {pxmsg.i &MSGNUM=123 &ERRORLEVEL=3}
            next-prompt rbd_eff_from.
            undo, retry.
         end.

         if rbd_memo_invoice > "" then do:
            find first ih_hist where ih_inv_nbr = rbd_memo_invoice
            no-lock no-error.
            if not available ih_hist then do:
               /* Invoice does not exist */
               {pxmsg.i &MSGNUM=8113 &ERRORLEVEL=2}
            end.
         end.
      end.
/*GUI*/ if global-beam-me-up then undo, leave.
 /* do on error undo */

      assign
         qad_datefld[1]  = rbd_eff_from
         qad_datefld[2]  = rbd_eff_to
         qad_charfld[9]  = string(rbd_price_change,"y/n")
         qad_decfld[1]   = rbd_amt
         qad_charfld[10] = rbd_memo_invoice.
   end.
/*GUI*/ if global-beam-me-up then undo, leave.
 /* Detail loop */

END PROCEDURE. /* procedure rb_dtl */
